<?php
namespace app\admin\validate;

use think\Validate;

class Admin extends Validate
{
    protected $rule = [
        'adminname' => 'require|max:30|unique:admin',
        'adminpwd' => 'require|min:5',
    ];
    protected $message = [
        'adminname.require' => '管理员名称不能为空',
        'adminname.max' => '管理员名称不超过30位',
        'adminname.unique' => '管理员名称不能重复',
        'adminpwd.require' => '管理员密码不能为空',
        'adminpwd.min' => '管理员密码不能小于5位',
    ];
    protected $scene = [
        'edit' => ['adminname'],
    ];

}